home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / util / simulare.sit / Simula 4.07 Reference / card_53488.txt < prev    next >
Text File  |  1989-05-02  |  2KB  |  128 lines

  1. -- card: 53488 from stack: in.07 Reference
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13647
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0002
  11. -- rect: left=12 top=79 right=312 bottom=199
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 2
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 3 (field)
  23. -- low flags: 00
  24. -- high flags: 0002
  25. -- rect: left=198 top=79 right=263 bottom=322
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 2
  30. -- text size: 9
  31. -- style flags: 0
  32. -- line height: 12
  33. -- part name: 
  34.  
  35.  
  36. -- part 4 (field)
  37. -- low flags: 00
  38. -- high flags: 0002
  39. -- rect: left=321 top=79 right=263 bottom=495
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 0
  43. -- font id: 2
  44. -- text size: 9
  45. -- style flags: 0
  46. -- line height: 12
  47. -- part name: 
  48.  
  49.  
  50. -- part 5 (button)
  51. -- low flags: 00
  52. -- high flags: A004
  53. -- rect: left=301 top=271 right=293 bottom=385
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 1
  57. -- font id: 0
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: Comments
  62. ----- HyperTalk script -----
  63. on mouseUp
  64.   go to card id 53606
  65. end mouseUp
  66.  
  67.  
  68.  
  69.  
  70. -- part contents for background part 2
  71. ----- text -----
  72. Coroutine example, solution
  73.  
  74. -- part contents for card part 1
  75. ----- text -----
  76. class Input;
  77. begin
  78.    integer I, Count;
  79.    Detach;
  80.    Ch := Inchar;
  81.    while Ch<>'!' do
  82.    begin
  83.        if Digit(Ch) then
  84.        begin
  85.            Count := Rank(Ch)-Rank('0');
  86.            Ch := Inchar;
  87.            for I := 1 step 1 until Count do
  88.               Resume(Writer);
  89.        end
  90.        else
  91.           Resume(Writer);
  92.    end;
  93.    Resume(Writer);
  94. end;
  95.  
  96. -- part contents for card part 3
  97. ----- text -----
  98. class Output;
  99. begin
  100.    Detach;
  101.    while Ch<>'!' do
  102.    begin
  103.       Outchar(Ch);
  104.       if Mod(Pos,4)=0 then
  105.          Outchar('  ');
  106.       if Pos>=121 then
  107.          Outimage;
  108.       Resume(Reader);
  109.    end;
  110.    if Pos>1 then
  111.       Outimage;
  112. end;
  113.  
  114.  
  115. -- part contents for card part 4
  116. ----- text -----
  117. Main program:
  118.  
  119. begin
  120.    class Input; ...;
  121.    class Output; ...;
  122.    character Ch;
  123.    ref(Input) Reader;
  124.    ref(Output) Writer;
  125.    Reader :- new Input;
  126.    Writer :- new Output;
  127.    Resume(Reader);
  128. end